﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Threading;

using Microsoft.Phone.Controls;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using System.Windows.Navigation;
using Microsoft.Xna.Framework.Graphics;

namespace ToDoClear.Motion
{

    public abstract class BaseMotion 
    {
        GameTimer timer;
        public BaseMotion()
        {
            timer=new GameTimer();

            timer.UpdateInterval = TimeSpan.FromMilliseconds(33.33);
            timer.Update += OnUpdate;
            timer.Draw += OnDraw;
            timer.Start();
        }


        private void OnUpdate(object sender, GameTimerEventArgs e)
        {
            OnTick();
           

            
        }
        public void Stop()
        {
            timer.Stop();
        }


        private void OnDraw(object sender, GameTimerEventArgs e)
        {

        }
 

        protected abstract void OnTick();

       

    }
}
